import 'package:app_tracking_transparency/app_tracking_transparency.dart';
import 'package:aqua_plunge/controller/DatabaseListController.dart';
import 'package:aqua_plunge/controller/UserController.dart';
import 'package:aqua_plunge/page/main_page.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';

void main(){
  runApp(const MyApp());
}

class MyApp extends StatefulWidget {
  const MyApp({super.key});

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {

  @override
  void initState() {
    super.initState();
    requestTta();
  }

  @override
  Widget build(BuildContext context) {
    return ScreenUtilInit(
        designSize: const Size(375,667),
        minTextAdapt: true,
        splitScreenMode: true,
        builder: (_,child){
          return GetMaterialApp(title: 'aqua-plunge',
              home: const MainPage(),
              initialBinding: InitialBinding());
        });
  }

  void requestTta() async{
    var status = await AppTrackingTransparency.requestTrackingAuthorization();
    if(status == TrackingStatus.authorized){

    }
  }
}

class InitialBinding extends Bindings{
  @override
  void dependencies() {
    Get.put(DatabaseController());
    Get.put(UserController());
  }
}
